<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:rich="http://richfaces.org/rich">
<body>

<ui:composition template="template/template.xhtml">

    <ui:define name="left">
        <h:form>
            <h:panelGrid columns="1">
            	<s:link view="/songList.xhtml" propagation="none">Song List</s:link>
                <s:link view="/artistList.xhtml" propagation="none">Artist List</s:link>
            </h:panelGrid>
        </h:form>
    </ui:define>

    <ui:define name="content">
		<s:div rendered="#{artistHome.managed}"><h1>Edit artist</h1></s:div>
		<s:div rendered="#{not artistHome.managed}"><h1>Add artist</h1></s:div>

	<p><h:message for="artistForm:artistName"/></p>

	<h:form id="artistForm">
		<f:verbatim>Name</f:verbatim>
		<h:inputText id="artistName" required="true" value="#{artistHome.artistName}" />

		<h:commandButton value="Add"
			action="#{artistHome.save}"
			rendered="#{!artistHome.managed}" />
		<h:commandButton value="Update"
		action="#{artistHome.save}"
			rendered="#{artistHome.managed}" />
		<h:commandButton value="Delete"
			action="#{artistHome.remove}" immediate="true"
			rendered="#{artistHome.managed}" />
	</h:form>

    </ui:define>

</ui:composition>

</body>
</html>
